Code and software for Shrinking fishes on the worlds hottest coral reefs

1. System requirements
The statistical analyses included in this manuscript were all conducted in R-studio 2022.12.0 using R-version 4.1.2 or above on Windows 11 (64 bit) machines. 

The statistical code uses the following packages:
lme4 v1.1-31
multcomp v1.4-20 
languageR v1.5.0
LMERConvenienceFunctions v3.0
emmeans v1.8.4-1 
MuMIn v1.47.1
EnvStats v2.7.0
broom.mixed v0.2.9.4
lmerTest v3.1-3
car v3.1-1
outliers v0.15
effectsize v0.8.3
rcompanion v2.4.30
MASS v7.3-58.1
r2glmm v0.1.2
pracma v2.4.2
ggplot2 v3.4.1
cowplot v1.1.1

2. Installation guide
2a) Install R and RStudio from posit.co (e.g., https://posit.co/download/rstudio-desktop/). Installation files are available for multiple flatforms, incdluing Windows, Mac, Ubuntu
2b) Install libraries within RStudio by pressing tools -> install packages -> paste the name of each package mentioned above -> press install. 
Total install time ~15min. 

3. Demo
3a) Open one of the attached r-script files in RStudio. 
3b) Place your cursor before the text in line 1 of the script and press run to run the code at each line. 
3c) by line 236 (r.squaredGLMM(JJ2)), you should see the following output within the console:
# R2m       R2c
# [1,] 0.9609386 0.9727849
The total run time should be less than 10min. 

4. Instructions for use
4a) Start by opening the first r-script (named "1 Lehren_body_size_correction_Jan2024.R") in RStudio. 
4b) Place your cursor before the text in line 1 of the script and press run to run the code at each line. 
4c) Pay attention to the annotated instructions within the script explaining each step. 
-Our r-script shows a) the code, b) the purpose of the code, c) the expected output from the code, and d) explanation of result. For instance, the code in line 230 shows: 
i) r.squaredGLMM(JJ2) 
ii) Purpose = Partial SSs, i.e. variance explained by each fixed and random effects in the model
iii) Output = R2m R2c,  [1,] 0.9609386 0.9727849
iv) Marginal fixed effects in the model explain 96% of the variance. Conditional random effects only explain about 1% more
4d) The total run time should be less than 10min.